package com.ease.integration.jms.listener;

import javax.jms.Message;
import javax.jms.TextMessage;

public abstract class TextMessageListenerCallback implements MessageListenerCallback {

	public abstract void onText(String text) throws Exception;

	public void onMessage(Message message) throws Exception {
		if (message instanceof TextMessage) {
			TextMessage textMessage = (TextMessage) message;
			String text = textMessage.getText();
			this.onText(text);
		}
	}

}
